<?php defined('SEJUJOPEFDNGJSL') or exit('Access denied');?>

<?php require("topbut.php");
?>
	<div class="panel panel-inverse">
        <div class="panel-heading">
            <h4 class="panel-title">转币会员</h4>
        </div>
        <div class="panel-body">
        	<form action="" method="post" name="theform" class="form-horizontal">
        		<script type="text/javascript">
				</script>
        		<fieldset style="border: none;">

					<div id="amountsel">


            <div class="form-group xfje">
  						<label class="col-md-3 control-label ui-sortable">用户名</label>
              <div class="col-md-9 ui-sortable">
  						  <input type="text" name="fromUname" id="fromUname" value="" class="form-control" />
              </div>
            </div>
                        <div class="form-group xfje">
                            <label class="col-md-3 control-label ui-sortable">Vic数量</label>
                            <div class="col-md-9 ui-sortable">
                                <input type="text" name="num" id="num" value="" class="form-control" />
                            </div>
                        </div>

					</div>
            <div class="form-group">
              <div class="col-md-9 col-md-offset-3 ui-sortable">
                <input type="button" onclick="check()" class="btn btn-md btn-primary" value="确定">
              </div>
            </div>
        </fieldset>
			</form>

        </div>
    </div>

<script type="text/javascript" src="/public/home/js/layer/layer.js"></script>


<script>
function check(){

      var fromUname=$('#fromUname').val();
      var num=$('#num').val();


      var index = layer.load(0, {shade: [0.5,'#8F8F8F']});
      var ajaxTimeoutTest =$.ajax({
      type: "get",
      dataType: "json",
      timeout : 13000,
      url: "/ajax.php?act=userCashCoin&fromUname="+fromUname+"&num="+num,
      success: function(data){
        if(data.status==0){
          layer.alert(data.tips, function(index){
              layer.closeAll();
          });

        }else{
          layer.alert(data.tips, function(index){
              window.location.href="home.php?lsact=index";
          });

        }

      },
      error: function(){

      },
      complete : function(XMLHttpRequest,status){ //请求完成后最终执行参数
　　　　　       if(status=='timeout'){//超时,status还有success,error等值的情况
 　　　　　      ajaxTimeoutTest.abort();
        layer.alert('现在人多请稍后重试，不要刷新页面，请重新提交！', function(index){
              layer.closeAll();
          });

　　　　     }
　　　　　 }
      });
  }

</script>

